# 斐波那契生成器

def fib(n):
    current = 0
    num1, num2 = 0, 1
    while current < n:
        num = num1
        num1, num2 = num2, num1 + num2
        current += 1
        yield num
    #return 'done'


F = fib(10)
for a in F:
    print(a)
# 0
# 1
# 1
# 2
# 3
# 5
# 8
# 13
# 21
# 34